the I2ctools was builded inout/target/product/xxxx/system/bin/i2cset
Source Documents
3. All the smooth generation of i2cdetect,i2cdump,i2cset,i2cget and other command tools;
4.adbpush I2cdetect/system/bin
Adbpush I2cdump/system/bin
Adbpush I2cset/system/bin
ADB push I2cget/system/bin
-----------------------Below is an example of the use of these four commands
The i2c-tools contains four files.
·
1. InstallationI2C drive load and rate changes check the blog "Raspberry School notes--I2C device load and rate settings".
2.I2C Bus ScanThe I2cdetect-l command allows you to view the I2C bus on the raspberry pie, and from the results of the return, the raspberry pie contains two I2C buses, and by reading the relevant data, the raspberry pie uses i2c0 for 1 generations, while the Raspberry Pie 2 uses i2c1.
pi@raspberrypi:~$
1.OV PWDN is a high level of effective, that is, high electricity peacetime camera sleep, at this time I2C also do not work (with i2cdetect detection), in low electricity peacetime camera work;
2.i2cdetect is a very good tool, you use this work, do not care about the device's register address and data bit width, as long as the device to ensure the operating voltage and its mount to which a I2C controller, y
0x68 (104) or 0x69 (105)Def _ init _ (self, port, ADDR = 0x68): # change the ADDR here to 68 and the original value is 69.
# Connection! [Rasp] (http://images.cnblogs.com/cnblogs_com/hangxin1940/466697/o_rasp_gpio.png "rasp ")
This figure specifies the position of 5 V output and 3 V output in the Two-row gpio real script to specify the direction
! [Rasp] (http://images.cnblogs.com/cnblogs_com/hangxin1940/466697/o_rasp_GPIOs_gy85.png "rasp ")
This figure details the connection between the GY-85'
Tags: Linux arm iic i²c EEPROM Read and write operationSeveral sets of i²c buses are detected[Email protected]:~# i2cdetect-li2c-0i2c OMAP i²c adapter i²c adapteri2c-1i2c OMAP i²c Adapter I²c Adapter[email protected]:~#Check the online status of the device on each bus:-y means yes,0 represents/dev/i2c-0[emailprotected]:~#i2cdetect-y-r00 12345678 9abcdef00: -------------------- ------10:------------------ --
module, initiating the operation of the I2C bus. Catch the signal, the line signal is 88, but did not get ack, so I2C Adpter drive return-6 error.
I2c-tools
Later, with the I2cdetect in I2c-tools, found that there is no equipment at the beginning, Insmod Drive module error, then I2cdetect, the discovery of equipment, the original is pt2314 power supply, the need for a delay in order to work properly.
about
Raspberry Pi. In this example, GROVE-RTC is used to provide a real-time clock for the Raspberry Pi, which communicates with the Raspberry Pi using I²c. Connection: The Grove RTC module can connect directly to the 5V pin of the Raspberry Pi, but you need to configure I²C before using RTC.1. First install the Linux i²c driver module:sudo aptitude install i2c-tools Libi2c-dev2. Load i2c-bcm2708 and rtc-ds1307:sudo modprode i2c-bcm2708sudo modprobe rtc-ds1307After the I²c configuration is complete,
1. Get the source code of I2C tools
Reference: http://lm-sensors.org/wiki/I2CTools
$ Wget http://dl.lm-sensors.org/i2c-tools/releases/i2c-tools-3.1.0.tar.bz2
2. Compile the source code
$ Tar-jxvf i2c-tools-3.1.0.tar.bz2
$ I2c-tools-3.1.0 CD
$ Cc = arm-None-Linux-gnueabi-GCC make (if not for embedded system, so without cc = arm-None-Linux-gnueabi-GCC)
Then you will get i2cdetct,I2cget, i2cset,I2cdump under tools directory.
3. Copy these tools to embedded system and use them
3.1
The default i²c is off, with the Raspi-config command, a configuration block will pop upSelect Enable I²c.After rebootThere are no i2c-x devices found in the/dev/directory, this time you need to do the following1. Add I²c Modulesudo nano/etc/modulesThen add the following two lines of contenti2c-bcm2708I2c-devIn the second reboot, you can see it.2. Install the I²c tool to view the I²C devicesudo apt-get install I2c-toolsProvides the following I²c tool commands, such as
1. i2c-dev Interface
I2C Dev-Interface
Generally, I2C devices are controlled by a kernel driver. However, in the user space, you can also access an I2C device: you need
Load the i2c-dev module.
Each registered I2C adapter (Controller) obtains a font size starting from 0. You can check
/Sys/class/i2c-dev to see which number the adapter corresponds. You can also run the "i2cdetect-L" command to obtain
Lists All I2C adapters of your current system. I2c
# Modify the configuration file
Raspberry Pi has integrated the I2C driver and only needs to be started.
Modify configuration file
Sudo nano/etc/modprobe. d/raspi-blacklist.conf
! [Configure] (http://images.cnblogs.com/cnblogs_com/hangxin1940/466697/o_rasp_i2c1.png "comment the third line ")Comment out the third line, CTRL + x save
Next, start the I2C module.
Sudo nano/etc/modules
! [Configure] (http://images.cnblogs.com/cnblogs_com/hangxin1940/466697/o_rasp_i2c2.png "add a line ")Add a
scenarios, it is necessary to use the external RTC module to provide the real-time clock for the Raspberry Pi. In this example, GROVE-RTC is used to provide a real-time clock for the Raspberry Pi, which communicates with the Raspberry Pi using I²c. Connection: The Grove RTC module can connect directly to the 5V pin of the Raspberry Pi, but you need to configure I²C before using RTC. 1. First install the Linux i²c driver module:sudo aptitude install i2c-tools Libi2c-dev2. Load i2c-bcm2708 and rt
The newly-obtained hardware is either good or bad, or there is no careless or detailed error, and of course the driver is required and combined with some electrical tools such as (oscilloscope) to detect.
1.SCCB:
This is, of course, the first test that must be detected. Here I am using the Iic-tools tool (Linux platform supports user-space-driven projects that require kernel compilation-related support). The source code can search for the transplant on the Web. The following will provide me with
the I²c tool to see:
sudo apt-get-y install i2c-tools
sudo i2cdetect-y 1
Parameter 1 refers to the device i2c-1, rpi2 on the default is 1,i2c0 reserved for e2prom use, did not toss open it. If you see a result similar to the following, it means that the hardware is OK.The above figure shows that there are two i²c devices connected to the bus, and their addresses are 0x48 and 0x77 respectively. If you do not see a device, check the hardware connecti
, configure and run the I2C kernel module, and set it to default boot loading:
Add a i2c-dev module to/etc/modules:
Run the I2cdetect command to view the BUS address of the ADT7410 device:
Verify that the ADT7410 Temperature Sensor works and the connection is normal. The adt7410.py verification test program:
After completing the preceding steps, the installation and configuration of Raspberry Pi and temperature sensor have been completed. In the
avoid confirmation of information. The i2cbus parameter indicates the I2C bus number to be scanned, which must be in the i2cdetect-l list; chip-address specifies the address of the chip on the bus, ranging from 0x03 to 0x77; data-address specifies the address of the data to be read from the chip, which ranges from 0x00 to 0 x ff. If mode is specified, the read/write mode is used. If this parameter is not specified, the read-only mode is used by defau
First, download the I2c-tools tool:Recently in the Transplant I2c-tools tool,: Https://i2c.wiki.kernel.org/index.php/I2C_Tools; Baidu to the git address in the wiki;1 git clone git://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git-b i2c-tools-3.1Download git to the external directory, write the ANDROID.MK, and package it system.img:ANDROID.MK content is as follows:1Local_path:= $ (Call my-dir)2 3 include $ (clear_vars)4 5Local_module_tags: =Optional6Local_c_includes + = $ (local_path) $ (L
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.